package com.evan.common.core.constant;

public enum LoginTypeEnum {
    DEFAULT(0, "默认"),CUSTOM(1, "海关"),ENTERPRISE(2, "企业");

    private int code;
    private String name;

    LoginTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static LoginTypeEnum getByCode(int code) {
        for (LoginTypeEnum type : LoginTypeEnum.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }

    public static LoginTypeEnum getByName(String name) {
        for (LoginTypeEnum type : LoginTypeEnum.values()) {
            if (type.getName().equals(name)) {
                return type;
            }
        }
        return null;
    }
}
